//
//  LSInfoSearchViewController.m
//  LaSaCivilAffairsDepartment
//
//  Created by 聂志康 on 2018/12/18.
//  Copyright © 2018 wpkj. All rights reserved.
//

#import "LSInfoSearchViewController.h"
#import "LSHomelessBeggerInfoSearchViewController.h"//流浪乞讨人员信息查询
#import "LSDisasterGoodsStorageStatusInfoSearchViewController.h"//救灾物资储备情况查询
#import "LSNaturalDisasterInfoSearchViewController.h"//自然灾害发生情况查询
#import "LSLoginViewController.h"

@interface LSInfoSearchViewController ()

@end

@implementation LSInfoSearchViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    if (![UserInfoModel sharedInstance].isLogin || [[UserInfoModel sharedInstance].customerId isEqualToString:@""]) [self presentLoginVC];
    // 流浪乞讨人员信息查询按钮
    UIButton *llqtInfoSearchButton = [[UIButton alloc] initWithFrame:CGRectMake(25, 15, ScreenWidth-50, 60)];
    llqtInfoSearchButton.backgroundColor = hexColor(60ace6);
    //1.设置阴影颜色
    llqtInfoSearchButton.layer.shadowColor = hexColor(BCBCBC).CGColor;
    //2.设置阴影偏移范围
    llqtInfoSearchButton.layer.shadowOffset = CGSizeMake(3, 3);
    //3.设置阴影颜色的透明度
    llqtInfoSearchButton.layer.shadowOpacity = 0.7;
    llqtInfoSearchButton.titleLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:17];
    [llqtInfoSearchButton setImage:[UIImage imageNamed:@"llqt"] forState:UIControlStateNormal];
    [llqtInfoSearchButton setTitle:@"流浪乞讨人员信息查询" forState:UIControlStateNormal];
    [llqtInfoSearchButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 6, 0, 0)];
    [llqtInfoSearchButton setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 6)];
    [llqtInfoSearchButton addTarget:self action:@selector(llqtInfoSearchButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:llqtInfoSearchButton];
    
    // 救灾物资储备情况查询按钮
    UIButton *jzwzInfoSearchButton = [[UIButton alloc] initWithFrame:CGRectMake(25, 85, ScreenWidth-50, 60)];
    jzwzInfoSearchButton.backgroundColor = hexColor(eea44d);
    //1.设置阴影颜色
    jzwzInfoSearchButton.layer.shadowColor = hexColor(BCBCBC).CGColor;
    //2.设置阴影偏移范围
    jzwzInfoSearchButton.layer.shadowOffset = CGSizeMake(3, 3);
    //3.设置阴影颜色的透明度
    jzwzInfoSearchButton.layer.shadowOpacity = 0.7;
    jzwzInfoSearchButton.titleLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:17];
    [jzwzInfoSearchButton setImage:[UIImage imageNamed:@"jzwz"] forState:UIControlStateNormal];
    [jzwzInfoSearchButton setTitle:@"救灾物资储备情况查询" forState:UIControlStateNormal];
    [jzwzInfoSearchButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 6, 0, 0)];
    [jzwzInfoSearchButton setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 6)];
    [jzwzInfoSearchButton addTarget:self action:@selector(jzwzInfoSearchButtonClick) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:jzwzInfoSearchButton];
    
    // 自然灾害发生情况查询按钮
//    UIButton *zrzhInfoSearchButton = [[UIButton alloc] initWithFrame:CGRectMake(25, 90, (ScreenWidth-60)/2, 60)];
//    zrzhInfoSearchButton.backgroundColor = hexColor(61c5a7);
//    //1.设置阴影颜色
//    zrzhInfoSearchButton.layer.shadowColor = hexColor(BCBCBC).CGColor;
//    //2.设置阴影偏移范围
//    zrzhInfoSearchButton.layer.shadowOffset = CGSizeMake(3, 3);
//    //3.设置阴影颜色的透明度
//    zrzhInfoSearchButton.layer.shadowOpacity = 0.7;
//    zrzhInfoSearchButton.titleLabel.font = [UIFont fontWithName:@"SourceHanSansCN-Regular" size:9];
//    [zrzhInfoSearchButton setImage:[UIImage imageNamed:@"zrzh"] forState:UIControlStateNormal];
//    [zrzhInfoSearchButton setTitle:@"自然灾害发生情况查询" forState:UIControlStateNormal];
//    [zrzhInfoSearchButton setTitleEdgeInsets:UIEdgeInsetsMake(0, 6, 0, 0)];
//    [zrzhInfoSearchButton setImageEdgeInsets:UIEdgeInsetsMake(0, 0, 0, 6)];
//    [zrzhInfoSearchButton addTarget:self action:@selector(zrzhInfoSearchButtonClick) forControlEvents:UIControlEventTouchUpInside];
//    [self.view addSubview:zrzhInfoSearchButton];
}

- (void)presentLoginVC {
    LSLoginViewController *loginVC = [[LSLoginViewController alloc] init];
    HEBaseNavController *loginNav = [[HEBaseNavController alloc] initWithRootViewController:loginVC];
    loginNav.modalPresentationStyle = UIModalPresentationFullScreen;
    [self presentViewController:loginNav animated:false completion:nil];
}

#pragma mark - 流浪乞讨人员信息查询
- (void)llqtInfoSearchButtonClick {
    LSHomelessBeggerInfoSearchViewController *homelessBeggerInfoSearchVC = [[LSHomelessBeggerInfoSearchViewController alloc] init];
    [self.navigationController pushViewController:homelessBeggerInfoSearchVC animated:true];
}

#pragma mark - 救灾物资储备情况查询
- (void)jzwzInfoSearchButtonClick {
    LSDisasterGoodsStorageStatusInfoSearchViewController *disasterGoodsStorageStatusInfoSearchVC = [[LSDisasterGoodsStorageStatusInfoSearchViewController alloc] init];
    [self.navigationController pushViewController:disasterGoodsStorageStatusInfoSearchVC animated:true];
}

#pragma mark - 自然灾害发生情况查询
- (void)zrzhInfoSearchButtonClick {
    LSNaturalDisasterInfoSearchViewController *naturalDisasterInfoSearchVC = [[LSNaturalDisasterInfoSearchViewController alloc] init];
    [self.navigationController pushViewController:naturalDisasterInfoSearchVC animated:true];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
